<?php
	$using_link_type_id=$banner->row()->using_link_type_id;
	$using_banner_area_id=$banner->row()->using_banner_area_id;
	$img_name=$banner->row()->img_name;
	$name=$banner->row()->name;
	$link=$banner->row()->link;
?>
<div class="row">
	<div class="col-md-12">
		<!-- Custom Tabs -->
		<div class="nav-tabs-custom">
			<ul class="nav nav-tabs">
				<li>
					<a href="<?php echo base_url();?>employers/welcome" > Welcome</a>
				</li>
				<li>
					<a href="<?php echo base_url(); ?>employers/job-ads"> New Job Ads</a>
				</li>
				<li>
					<a href="<?php echo base_url(); ?>employers/current-job-ads">My Current Job Ads</a>
				</li>
				<li>
					<a href="<?php echo base_url(); ?>employers/expired-job-ads">Expired Job Ads</a>
				</li>
				<li class="active">
					<a href="<?php echo base_url(); ?>employers/banners">Banners</a>
				</li>
				<li class="dropdown pull-right">
					<a class="dropdown-toggle" data-toggle="dropdown" href="#"> <i class="glyphicon glyphicon-user"/></i><?php echo $username; ?>
					<span class="caret"></span> </a>
					<ul class="dropdown-menu">
						<li role="presentation">
							<a role="menuitem" tabindex="-1" href="<?php echo base_url(); ?>employers/change-picture">Change Picture</a>
						</li>
						<li role="presentation">
							<a role="menuitem" tabindex="-1" href="<?php echo base_url(); ?>employers/change-password">Change Password</a>
						</li>
						<li role="presentation">
							<a role="menuitem" tabindex="-1" href="<?php echo base_url(); ?>employers/profile">Profile</a>
						</li>
						<li role="presentation" class="divider"></li>
						<li role="presentation">
							<a role="menuitem" tabindex="-1" href="<?php echo base_url(); ?>employers/logout">Logout</a>
						</li>
					</ul>
				</li>
				
			</ul>
			<div class="tab-content">
				<div class="tab-pane active" id="tab_1">

					<form role="form" class="remove-box-border" method="post" action="<?php echo base_url(); ?>employers/update-banner/<?php echo $this->uri->segment(3);?>" enctype="multipart/form-data">
						<div class="box box-primary">
							<div class="box-header">
								<h3 class="box-title"><span style="color:#3C8DBC !important;">Update banner</span></h3>
							</div><!-- /.box-header -->
							<!-- form start -->

							<div class="box-body">

								<div class="form-group">
									<label for="name">Name <span class="required">*</span></label>
									<input type="text" class="form-control" id="name" name="name" placeholder="" value="<?php echo $name; ?>" required="required">
									<?php echo form_error('name'); ?>
								</div>
								<div class="form-group">
									<label for="image">Image </label>
									<input type="file" class="form-control" id="image" name="userfile">
									<?php
									if(isset($errors)){
										echo $errors['error'];
									}
								?>
								</div>
								<div class="form-group">
									<label for="link_type">Link Type </label>
									<select name="link_type" class="form-control">
										<?php
											foreach($link_types->result() as $row){
												$link_type_id=$row->link_type_id;
												$name=$row->name;
										?>
												<option value="<?php echo $link_type_id;?>" <?php echo ($using_link_type_id==$link_type_id)? 'selected':'';?>><?php echo $name;?></option>
										<?php
											}
										?>
									</select>

								</div>
								<div class="form-group">
									<label for="link">Link <span class="required">*</span></label>
									<input type="text" class="form-control" id="link" name="link" placeholder="Url" value="<?php echo $link; ?>" required="required">
									<p class="help-block">
										(*) (Ex. http://www.company.com)
									</p>
									<?php echo form_error('link'); ?>
								</div>
								<div class="form-group">
									<label for="areas">Area </label>
									<select name="areas" class="form-control">
										<?php
											foreach($banner_areas->result() as $row){
												$banner_area_id=$row->banner_area_id;
												$name=$row->name;
										?>
												<option value="<?php echo $banner_area_id;?>" <?php echo ($using_banner_area_id==$banner_area_id)? 'selected':'';?>><?php echo $name;?></option>
										<?php
											}
										?>
									</select>

								</div>

							</div><!-- /.box-body -->

							<div class="box-footer">
								<button type="submit" class="btn btn-success">
									<span class="glyphicon glyphicon-saved"></span> Submit
								</button>
								<button type="button" onclick="goBack();" class="btn btn-warning">
									<span class="glyphicon glyphicon-remove-circle"></span> Cancel
								</button>
							</div>

						</div><!-- /.box -->
					</form>
				</div><!-- /.tab-pane -->
			</div><!-- /.tab-content -->
		</div><!-- nav-tabs-custom -->
	</div><!-- /.col -->
</div>
